local jacketPath;

function GetSongJacket(song)
	if song then
		local path = song:GetJacketPath()
		if path then return path end
	end
	return THEME:GetPathG("","_blank")
end

local t = Def.ActorFrame{
	LoadActor("NormalPart")..{
	};
	
	Def.Banner {
		Name="SongJacket";
		InitCommand=cmd(diffusealpha,0.8;x,110;y,-12);
		SetMessageCommand=function(self, params)
			local bUseJacket = GetAdhocPref("ShowJackets");
			if bUseJacket then
				self:visible(true);	
				if not GAMESTATE:IsCourseMode() then
					local song = params.Song;
					if song then
						self:LoadBackground(GetSongJacket(params.Song));
						self:zoomtowidth(60);
						self:zoomtoheight(60);
						self:croptop(0.4);
						self:diffusealpha(1);
						self:diffusetopedge(color("1,1,1,0.5"));
						self:diffuserightedge(color("1,1,1,0"));
					else
						self:diffusealpha(0);
					end;
				else
					self:diffusealpha(0);
				end;
			else
				self:visible(false);
			end;
		end;
	};
};

return t;